programming4us
           
 
 
Programming

iPad SDK : Keyboard Extensions and Replacements (part 1) - Adding a Keyboard Button in Dudel

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/2/2010 2:49:43 PM
Did you ever notice that when you're filling in a web-based form in Mobile Safari, a small row of additional buttons appears above the keyboard, containing buttons labeled Previous, Next, and so on? iOS 3.2 gives us a way to do that sort of thing, too, using the new inputAccessoryView property of UITextView and UITextField. You just put anything you like into a UIView (buttons, labels, sliders ... you name it), and pass that view off to the text-input object in question.

As if that weren't enough, starting with OS 3.2 we can now replace the entire keyboard! The idea is similar to that for the accessory view. UIView has a new inputView property that you can set, using any UIView you like.

1. Adding a Keyboard Button in Dudel

To demonstrate how to extend the keyboard, we're going to add something that has been missing from the FileRenameViewController in Dudel: the ability to cancel the renaming operation. We'll do this by adding a Cancel button to the keyboard.

Open FileRenameViewController.m, and add the following method to set up the input accessory view:

- (void)viewDidLoad {
[super viewDidLoad];
UIView *inputAccessoryView = [[UIView alloc] initWithFrame:
CGRectMake(0.0, 0.0, 768.0, 77.0)];
inputAccessoryView.backgroundColor = [UIColor darkGrayColor];
UIButton *cancelButton = [UIButton buttonWithType:
UIButtonTypeRoundedRect];
cancelButton.frame = CGRectMake(20.0, 20.0, 100.0, 37.0);
[cancelButton setTitle: @"Cancel" forState:UIControlStateNormal];
[cancelButton setTitleColor:[UIColor blackColor] forState:
UIControlStateNormal];
[cancelButton addTarget:self action:@selector(cancel:)
forControlEvents:UIControlEventTouchUpInside];
[inputAccessoryView addSubview:cancelButton];
textField.inputAccessoryView = inputAccessoryView;
}

Also add the method that actually does the canceling:

- (void)cancel:(id)sender {
[delegate fileRenameViewController:self didRename:originalFilename
to:originalFilename];
}

Now build and run your app, bring up the file renaming view, and you'll see something like Figure 1.

Figure 1. Here's the Cancel button we've just added, making this keyboard view more useful.

Other -----------------
- iPad SDK : New Input Methods - Gesture Recognition
- iPad SDK : New Input Methods - Menu Additions
- iPad SDK : Implementing an About Panel in a Modal Way (part 2)
- iPad SDK : Implementing an About Panel in a Modal Way (part 1) - Creating the Modal Web View Controller
- Parallel Programming with Microsoft .Net : Dynamic Task Parallelism - Variations
- Keyword Research Tools (part 7) - comScore Marketer
- Keyword Research Tools (part 6)
- Keyword Research Tools (part 5)
- Keyword Research Tools (part 4)
- Keyword Research Tools (part 3)
- Keyword Research Tools (part 2)
- Keyword Research Tools (part 1) - Keyword Research Data from the Engines
- The Art of SEO : Traditional Approaches: Domain Expertise, Site Content Analysis
- The Art of SEO : The Theory Behind Keyword Research
- jQuery 1.3 : Headline rotator (part 7)
- jQuery 1.3 : Headline rotator (part 6)
- jQuery 1.3 : Headline rotator (part 5) - Pause on hover
- jQuery 1.3 : Headline rotator (part 4) - The headline rotate function
- jQuery 1.3 : Headline rotator (part 3) - Setting up the rotator
- jQuery 1.3 : Headline rotator (part 2) - Retrieving the feed
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us